package ch.reevolt.mosaic;

import java.util.ArrayList;
import java.util.List;

import android.content.ContentResolver;
import android.content.Context;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.provider.MediaStore;
import android.provider.MediaStore.Images.ImageColumns;
import android.util.Log;

public class ImageLoader {

	public static List<Bitmap> getCameraImages(Context context) {
		// where contextObject is your activity
		ContentResolver cr = context.getContentResolver();

		String[] columns = new String[] { ImageColumns._ID, ImageColumns.TITLE,
				ImageColumns.DATA, ImageColumns.MIME_TYPE, ImageColumns.SIZE , ImageColumns.BUCKET_DISPLAY_NAME};

		Cursor cur = cr.query(MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
				columns, null, null, null);
		
		ArrayList<Bitmap> retVal = new ArrayList<Bitmap>();
		
		
		if(cur.moveToFirst()){
			do{
				Log.d("->","" + cur.getColumnIndex(ImageColumns._ID));
				Log.d("->","" + cur.getColumnIndex(ImageColumns.TITLE));
				Log.d("->","" + cur.getColumnIndex(ImageColumns.DATA));
				Log.d("->","" + cur.getColumnIndex(ImageColumns.MIME_TYPE));
				Log.d("->","" + cur.getColumnIndex(ImageColumns.BUCKET_DISPLAY_NAME));
				Log.d("->","--------------------------------------------------------------");
			}while(cur.moveToNext());
		}
		
	
		
		
		return retVal;
	}

}
